/*
 * @Description  :
 * @Autor        : guoxi
 * @Date         : 2022-06-08 17:28:51
 * @LastEditors  : Please set LastEditors
 * @LastEditTime : 2022-08-22 16:27:07
 * @FilePath     : \rpms\src\api\user.ts
 */
// import { http } from "../utils/http";
import http from "../utils/http/service";
import qs from "qs";

// 登录
// export const getLogin = (data: object): any => {
//   return http.request("post", "/login", data);
// };

// // 注册
// export const getRegist = (data: object): any => {
//   return http.request("post", "/register", data);
// };

// 登录
export const login = (data): any => {
  return http.post(`/rdms-admin/login?${qs.stringify(data)}`);
};

// 退出登录
export const postLogout = (): any => {
  return http.post(`/rdms-admin/sysUser/toLogout`);
};

// 获取用户列表
export const getUsersForScience = (data): any => {
  return http.post("/rdms-admin/scienceMember/detail/users", data);
};
export const getUsers = (data): any => {
  return http.post("/rdms-admin/scienceMember/users", data);
};
export const getUserList = (data): any => {
  return http.post("/rdms-admin/scienceMember/userList", data);
};
export const getUserSysList = (data): any => {
  return http.post("/rdms-admin/sysUser/userList", data);
};

export const getUserList2 = (data): any => {
  return http.post("/rdms-admin/scienceMember/users", data);
};

// 删除用户
export const deleteUser = (data): any => {
  return http.post("/rdms-admin/scienceMember/delete", data);
};

// 新增用户
export const addUser = (data): any => {
  return http.post("/rdms-admin/scienceMember/add", data);
};

// 更改用户
export const updateUser = (data): any => {
  return http.post("/rdms-admin/sysUser/update", data);
};
export const updateScienceUser = (data): any => {
  return http.post("/rdms-admin/scienceMember/update", data);
};

// 查询用户信息
export const postUserInfo = (data): any => {
  return http.post("/rdms-admin/sysUser/userInfo", data);
};

export const postScienceUserInfo = (data): any => {
  return http.post("/rdms-admin/scienceMember/userInfo", data);
};

// 个人中心
export const postUserInfoProfile = (data): any => {
  return http.post("/rdms-admin/sysUser/userInfo", data);
};

// 给用户赋予角色
export const userRoleAuth = (data): any => {
  return http.post("/rdms-admin/sysUser/userRoleAuth", data);
};

// 查询用户赋予角色
export const searchRoleAuth = (data): any => {
  return http.post("/rdms-admin/sysUser/userRoles", data);
};

//
export const postToLogout = (data): any => {
  return http.post("/rdms-admin/logout", data);
};

// 重置密码
export const resetPassword = (data): any => {
  return http.post("/rdms-admin/sysUser/resetPass", data);
};

// 更新密码
export const updatePassword = (data): any => {
  return http.post("/rdms-admin/sysUser/update/pwd", data);
};

// 获取项目用户列表
export const getUserListPro = (data): any => {
  return http.post("/rdms-admin/sysUser/userListPro", data);
};

// 新增项目人员列表用户
export const addUserPro = (data): any => {
  return http.post("/rdms-admin/sysUser/addPro", data);
};

// 更改项目人员列表用户
export const updateUserPro = (data): any => {
  return http.post("/rdms-admin/sysUser/updatePro", data);
};

// 更改项目人员列表用户
export const addSysUser = (data): any => {
  return http.post("/rdms-admin/sysUser/add", data);
};
